package com.woniu.springboot.service.serviceImpl;

import com.woniu.springboot.entity.Department;
import com.woniu.springboot.mapper.DepartmentMapper;
import com.woniu.springboot.service.IDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;

@Service
public class DepartmentServiceImpl implements IDepartmentService {

    @Autowired
    private DepartmentMapper departmentMapper;

    @Override
    public Collection<Department> findDepartmentAll() {
        return departmentMapper.getDepartments();
    }

    @Override
    public Department findDepartmentByKey(Integer id) {
        return departmentMapper.getDepartment(id);
    }
}
